package com.hopscotch.controller;

import com.hopscotch.entity.User;
import com.hopscotch.service.UserService;
import com.hopscotch.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R userLogin(@RequestBody User user){
        String token = userService.userLogin(user);
        return R.ok(token);
    }
    @GetMapping("/getattendance")
    public R getAttendance(){
        return R.ok(userService.getAttendance());
    }
}
